﻿using Model.BusinessModel.OutPut;
using Model.BusinessModel.OutPut.sys;
using Model.DomainModel.Sys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.IRepository.Sys
{
    /// <summary>
    /// 角色仓储接口
    /// </summary>
    public interface ISysRoleRepository : IRepository<SysRole>
    {
        /// <summary>
        /// 获取全部角色
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <param name="authWhere">授权条件</param>
        /// <returns></returns>
        List<SysRoleOutPut> GetAllRoleTreeList(string? corporationKey, string authWhere);

        /// <summary>
        /// 根据公司和系统获取数据
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <param name="systemKey">系统key</param>
        /// <returns></returns>
        List<SysRole> GetRoleByCorporationKeyOrSystemKey(string corporationKey, string systemKey);

        /// <summary>
        /// 根据角色名称获取数据
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <param name="systemKey">系统key</param>
        /// <param name="roleName">角色名称</param>
        /// <returns></returns>
        SysRole? GetRoleByName(string corporationKey, string systemKey, string roleName);

        /// <summary>
        /// 设置系统是否启用
        /// </summary>
        /// <param name="keys">key集合</param>
        /// <param name="isOpen">是否启用</param>
        void SetRoleIsOpen(List<string> keys, bool isOpen);

        /// <summary>
        /// 获取角色
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <param name="systemKey">系统key</param>
        /// <returns></returns>
        List<TreeOutPut> GetRoleList(string corporationKey, string systemKey);
    }
}
